package a.j;

import a.c.ab;
import a.c.cb;
import a.c.d;
import a.c.e;
import a.c.u;
import a.c.y;
import a.d.w;
import a.j.a.j;

import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Collections;
import java.util.Iterator;

public class xf
  extends gf
{
  double m;
  double G;
  protected zd H;
  e_ I;
  protected a.c.z J;
  ld K;
  tb L;
  private boolean M = true;
  private boolean N;
  private boolean O;
  private f_ P = new f_();
  private boolean Q;
  private w R;
  private double S = 10.0D;
  private w T;
  private boolean U = true;
  private boolean V = true;
  private boolean W = true;
  private boolean X = true;
  private w Y;
  private boolean Z;
  private z ab = new z(null);
  private boolean bb;
  private boolean cb;
  private boolean db;
  private boolean eb;
  private u fb;
  private PropertyChangeListener gb;
  private int hb = 2;
  private final Ellipse2D ib = new Ellipse2D.Double();
  public static int jb;
  
  public xf()
  {
    this(null);
  }
  
  public xf(df paramdf)
  {
    super(paramdf);
    this.ab.b(false);
    this.ab.d(false);
    this.ab.c(true);
    this.ab.h(true);
    this.ab.c(10.0D);
    this.ab.e(20.0D);
    this.gb = new PropertyChangeListener()
    {
      public void propertyChange(PropertyChangeEvent paramAnonymousPropertyChangeEvent)
      {
        boolean bool = ld.E;
        if (!bool) {
          if (xf.this.fb != null)
          {
            if (bool) {
              break label69;
            }
            if ((paramAnonymousPropertyChangeEvent.getOldValue() instanceof g))
            {
              ((g)paramAnonymousPropertyChangeEvent.getOldValue()).b(xf.this.fb);
              xf.this.fb = null;
            }
          }
        }
        if ((bool) || (xf.this.a())) {
          label69:
          xf.this.b();
        }
      }
    };
  }
  
  public boolean v()
  {
    return this.eb;
  }
  
  public void g(boolean paramBoolean)
  {
    this.eb = paramBoolean;
  }
  
  public boolean w()
  {
    return this.db;
  }
  
  public void h(boolean paramBoolean)
  {
    this.db = paramBoolean;
  }
  
  public boolean x()
  {
    return this.cb;
  }
  
  public void i(boolean paramBoolean)
  {
    this.cb = paramBoolean;
  }
  
  public boolean y()
  {
    return this.bb;
  }
  
  public void j(boolean paramBoolean)
  {
    this.bb = paramBoolean;
  }
  
  public z z()
  {
    return this.ab;
  }
  
  public void a(z paramz)
  {
    this.ab = paramz;
  }
  
  public boolean A()
  {
    return this.W;
  }
  
  public void k(boolean paramBoolean)
  {
    this.W = paramBoolean;
  }
  
  public boolean B()
  {
    return this.X;
  }
  
  public void l(boolean paramBoolean)
  {
    this.X = paramBoolean;
  }
  
  public boolean C()
  {
    return this.U;
  }
  
  public void m(boolean paramBoolean)
  {
    this.U = paramBoolean;
  }
  
  public boolean D()
  {
    return this.V;
  }
  
  public void n(boolean paramBoolean)
  {
    this.V = paramBoolean;
  }
  
  public int F()
  {
    return this.hb;
  }
  
  public void d(int paramInt)
  {
    this.hb = paramInt;
  }
  
  protected boolean c(MouseEvent paramMouseEvent)
  {
    if (!ld.E) {}
    return (paramMouseEvent.getModifiers() & F()) != 0;
  }
  
  public boolean G()
  {
    return this.O;
  }
  
  public void o(boolean paramBoolean)
  {
    this.O = paramBoolean;
  }
  
  protected sc a(double paramDouble1, double paramDouble2)
  {
    sc localsc = new sc(this.i, paramDouble1, paramDouble2, true, 0);
    a(localsc);
    return localsc;
  }
  
  public void mousePressedLeft(double paramDouble1, double paramDouble2)
  {
    boolean bool3 = ld.E;
    boolean bool2 = ld.D;
    sc localsc = a(paramDouble1, paramDouble2);
    if (!bool3) {
      if (localsc.u())
      {
        g localg = k();
        a(true);
        this.H = localsc.r();
        y localy = localsc.h();
        if (localy.e()) {}
        do
        {
          localObject1 = (zd)localy.j();
          if (bool2) {
            break label160;
          }
          if (localObject1 == ((zd)localObject1).c().l())
          {
            this.H = ((zd)localObject1);
            if (bool3) {
              continue;
            }
            if (!bool2) {}
          }
          else
          {
            localy.f();
            if (!bool2) {
              break;
            }
          }
          a(this.H);
          this.m = paramDouble1;
          this.G = paramDouble2;
        } while (bool3);
        this.L = this.H.c();
        label160:
        Object localObject1 = this.L.i();
        this.Q = false;
        this.P.o();
        boolean bool1 = G();
        if (!bool3)
        {
          if (bool1)
          {
            localg.z();
            this.Q = true;
            this.i.a(this.P);
          }
          localg.a(new ab((d)localObject1).l());
          this.L = this.H.c();
        }
        Object localObject2;
        Object localObject3;
        Object localObject4;
        if (!bool3)
        {
          if (this.H == this.L.k())
          {
            this.N = true;
            this.K = this.L.h();
            if (!bool3) {
              this.T = localg.r((d)localObject1);
            }
            this.Y = (this.L.n() == 0 ? localg.s(this.L.i()) : new w(this.L.p().b(), this.L.p().c()));
            if (bool3) {
              break label648;
            }
            if (!bool1) {
              break label625;
            }
            localObject2 = this.P.a(b(paramDouble1, paramDouble2 + 50.0D));
            localObject3 = this.P.a(a(this.L.g()));
            localObject4 = this.P.a((e)localObject2, (e)localObject3, a(this.L));
            this.P.t((d)localObject4).k().b(0.0D, 0.0D);
            if (bool3) {
              break label648;
            }
            if (!bool2) {
              break label625;
            }
          }
          this.N = false;
          this.K = this.L.g();
          if (bool3) {
            break label505;
          }
          this.T = localg.s((d)localObject1);
        }
        label505:
        this.Y = (this.L.n() == 0 ? localg.r(this.L.i()) : new w(this.L.q().b(), this.L.q().c()));
        if (!bool3)
        {
          if (bool1)
          {
            localObject2 = this.P.a(a(this.L.h()));
            localObject3 = this.P.a(b(paramDouble1, paramDouble2 + 50.0D));
            localObject4 = this.P.a((e)localObject2, (e)localObject3, a(this.L));
            this.P.t((d)localObject4).l().b(0.0D, 0.0D);
          }
          label625:
          a(this.K, (d)localObject1);
          localg.V();
          this.L.c(true);
        }
        label648:
        if (!bool3) {}
        this.L.b(!bool1);
        this.Z = a(this.L.i());
        e(paramDouble1, paramDouble2);
        if (!bool3) {
          if (this.Z)
          {
            if (bool3) {
              break label1059;
            }
            if (this.bb)
            {
              if (!bool3) {}
              localObject2 = this.P.n() ? this.L : this.P.t(this.P.q());
              if (!bool3)
              {
                if (((tb)localObject2).n() == 0) {
                  e(paramDouble1 + 10.0D, paramDouble2 + 10.0D);
                }
              }
              else {
                e(paramDouble1, paramDouble2);
              }
              localObject3 = new w(paramDouble1, paramDouble2);
              if (this.N)
              {
                if (bool3) {
                  break label826;
                }
                localObject4 = ((tb)localObject2).p();
                if (!bool2) {
                  break label828;
                }
              }
              label826:
              localObject4 = ((tb)localObject2).q();
              label828:
              if ((!bool3) && (localObject4 == null)) {
                break label1065;
              }
              if (!bool3) {
                if (((eb)localObject4).b() == paramDouble1)
                {
                  b = 1;
                  if ((!bool3) && (!bool2)) {
                    break label869;
                  }
                }
              }
              byte b = 2;
              label869:
              z.s_ locals_ = new z.s_(this.H, (w)localObject3, (byte)3);
              z.r_ localr_ = new z.r_((eb)localObject4, new w(((eb)localObject4).b(), ((eb)localObject4).c()), b);
              w localw = new w(paramDouble1, paramDouble2);
              this.ab.a(this.i);
              this.ab.j();
              this.ab.c();
              this.ab.a(localw, Collections.EMPTY_LIST, Collections.singletonList(localr_), Collections.singletonList(locals_), q.a(null));
              if (!bool3) {
                if (this.cb) {
                  a(b);
                }
              }
              if (!bool3)
              {
                if (this.X) {
                  this.ab.a(new ve(0.9D, null)
                  {
                    private final w val$initialCoordinates;
                    private final z.q_ val$bendInfo;
                    
                    public byte a(w paramAnonymousw, Point2D.Double paramAnonymousDouble, byte paramAnonymousByte)
                    {
                      boolean bool = ld.E;
                      double d1 = paramAnonymousDouble.x - this.val$initialCoordinates.a;
                      double d2 = paramAnonymousDouble.y - this.val$initialCoordinates.b;
                      w localw = xf.this.a(paramAnonymousDouble.x, paramAnonymousDouble.y, xf.this.S / xf.this.i.M(), xf.this.K, this.val$bendInfo.a(d1, d2));
                      byte b = 0;
                      if (!bool) {
                        if (paramAnonymousDouble.x == localw.a)
                        {
                          if (bool) {
                            break label148;
                          }
                          if (paramAnonymousDouble.y == localw.b) {
                            break label146;
                          }
                        }
                      }
                      b = 3;
                      paramAnonymousDouble.x = localw.a;
                      paramAnonymousDouble.y = localw.b;
                      label146:
                      label148:
                      return b;
                    }
                    
                    public boolean a(w paramAnonymousw1, w paramAnonymousw2, byte paramAnonymousByte)
                    {
                      double d1 = paramAnonymousw2.a - this.val$initialCoordinates.a;
                      double d2 = paramAnonymousw2.b - this.val$initialCoordinates.b;
                      return xf.this.a(paramAnonymousw2.a, paramAnonymousw2.b, xf.this.S / xf.this.i.M(), xf.this.K, this.val$bendInfo.a(d1, d2)).equals(paramAnonymousw2);
                    }
                  });
                }
                if (bool3) {
                  break label1066;
                }
                this.ab.a(new ve(0.9D)
                {
                  public boolean a(w paramAnonymousw1, w paramAnonymousw2, byte paramAnonymousByte)
                  {
                    boolean bool = ld.E;
                    w localw = xf.this.a(paramAnonymousw1.a, paramAnonymousw1.b, xf.this.S);
                    if ((bool) || (localw != null)) {
                      if (bool) {}
                    }
                    return localw.equals(paramAnonymousw2);
                  }
                  
                  public byte a(w paramAnonymousw, Point2D.Double paramAnonymousDouble, byte paramAnonymousByte)
                  {
                    w localw = xf.this.a(paramAnonymousw.a, paramAnonymousw.b, xf.this.S);
                    if (!ld.E)
                    {
                      if (localw != null)
                      {
                        paramAnonymousDouble.x = localw.a;
                        paramAnonymousDouble.y = localw.b;
                      }
                    }
                    else {
                      return 3;
                    }
                    return paramAnonymousByte;
                  }
                });
              }
              if (!bool2) {
                break label1065;
              }
            }
          }
        }
        label1059:
        this.ab.g();
        label1065:
        label1066:
        if (!bool3)
        {
          if (this.fb == null)
          {
            this.fb = new u()
            {
              private final d val$edge;
              
              public void a(cb paramAnonymouscb)
              {
                if ((ld.E) || ((paramAnonymouscb.a() == 5) && (paramAnonymouscb.b().equals(this.val$edge)))) {
                  xf.this.H();
                }
              }
            };
            localg.a(this.fb);
          }
          this.i.addPropertyChangeListener("Graph2D", this.gb);
          this.i.e(1);
        }
        this.i.a(O());
        if (!bool3) {
          if (!bool2) {
            return;
          }
        }
      }
      else
      {
        this.H = null;
      }
    }
    g();
  }
  
  private void H()
  {
    boolean bool = ld.E;
    this.i.b(this.P);
    this.P.o();
    I();
    if (!bool)
    {
      if (this.Q)
      {
        k().A();
        this.Q = false;
      }
      if (bool) {}
    }
    else if (a())
    {
      a(false);
    }
    g();
  }
  
  private void a(byte paramByte)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    double d1 = this.K.B();
    double d2 = this.K.A();
    double d3;
    double d4;
    double d5;
    double d6;
    if (paramByte == 1)
    {
      d3 = this.ab.w();
      if ((bool2) || ((d3 > 0.0D) && ((bool2) || (this.K.c() / d3 < 40.0D))))
      {
        d4 = this.K.b() - 5.0D;
        d5 = this.K.b() + this.K.d() + 5.0D;
        d6 = d2;
        do
        {
          do
          {
            if (d6 <= this.K.a()) {
              break;
            }
            this.ab.a(new ue((byte)1, (byte)16, new w(d6, d1), d4, d5, this.K, 0.01D));
            d6 -= d3;
            if (bool2) {
              break label216;
            }
            if (bool1) {
              break label198;
            }
          } while (!bool1);
        } while (bool2);
        d6 = d2 + d3;
        label198:
        label216:
        do
        {
          if (d6 >= this.K.a() + this.K.c()) {
            break;
          }
          this.ab.a(new ue((byte)1, (byte)16, new w(d6, d1), d4, d5, this.K, 0.01D));
          d6 += d3;
        } while (!bool1);
      }
    }
    else
    {
      d3 = this.ab.w();
      if ((bool2) || ((d3 > 0.0D) && ((bool2) || (this.K.d() / d3 < 40.0D))))
      {
        d4 = this.K.a() - 5.0D;
        d5 = this.K.a() + this.K.c() + 5.0D;
        d6 = d1;
        do
        {
          do
          {
            if (d6 <= this.K.b()) {
              break;
            }
            this.ab.a(new ue((byte)0, (byte)16, new w(d2, d6), d4, d5, this.K, 0.01D));
            d6 -= d3;
            if (bool2) {
              break label452;
            }
            if (bool1) {
              break label434;
            }
          } while (!bool1);
        } while (bool2);
        d6 = d1 + d3;
        label434:
        label452:
        do
        {
          if (d6 >= this.K.b() + this.K.d()) {
            break;
          }
          this.ab.a(new ue((byte)0, (byte)16, new w(d2, d6), d4, d5, this.K, 0.01D));
          d6 += d3;
        } while (!bool1);
      }
    }
  }
  
  protected tb a(tb paramtb)
  {
    return paramtb.e();
  }
  
  protected ld a(ld paramld)
  {
    return paramld.m();
  }
  
  protected ld b(double paramDouble1, double paramDouble2)
  {
    od localod = new od();
    localod.b(0.1D, 0.1D);
    localod.d(false);
    localod.c(paramDouble1, paramDouble2);
    localod.b((byte)0);
    return localod;
  }
  
  private void a(ld paramld, d paramd)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    this.i.a();
    if (!bool2) {
      if (this.I != null) {
        this.i.b(this.I);
      }
    }
    double d = this.i.w();
    if (!bool2)
    {
      if (d <= 0.0D) {
        d = 20.0D;
      }
      this.J = a(paramld.n(), paramd, d);
    }
    Rectangle2D.Double localDouble1 = new Rectangle2D.Double(paramld.a() - 10.0D, paramld.b() - 10.0D, paramld.c() + 20.0D, paramld.d() + 20.0D);
    y localy = this.J.h();
    if (localy.e()) {}
    do
    {
      w localw = (w)localy.j();
      Rectangle2D.Double localDouble2 = new Rectangle2D.Double(localw.a - 10.0D, localw.b - 10.0D, 20.0D, 20.0D);
      localDouble1.add(localDouble2);
      localy.f();
      if ((!bool2) && (bool1)) {
        return;
      }
      if (!bool1) {
        break;
      }
      this.I = new e_(this.J, localDouble1, paramld.n(), paramd);
      this.i.a(this.I);
    } while (bool2);
    this.i.b();
  }
  
  protected a.c.z a(e parame, d paramd, double paramDouble)
  {
    boolean bool = ld.E;
    if (!bool)
    {
      if (!this.U) {
        return b(parame, paramd);
      }
      if (bool) {}
    }
    else if (D())
    {
      return a(parame, paramd);
    }
    return this.i.a().w(parame).g(paramDouble);
  }
  
  private a.c.z a(e parame, d paramd)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    a.c.z localz = new a.c.z();
    ld localld = this.i.a().w(parame);
    if ((bool2) || (localld.y() > 0))
    {
      Iterator localIterator = localld.z();
      do
      {
        if (!localIterator.hasNext()) {
          break;
        }
        if (bool1) {
          break label90;
        }
        localz.add(((jd)localIterator.next()).h());
      } while (!bool1);
    }
    label90:
    return localz;
  }
  
  protected a.c.z b(e parame, d paramd)
  {
    boolean bool = ld.E;
    a.c.z localz = new a.c.z();
    ld localld = this.i.a().w(parame);
    double d1 = localld.A();
    double d2 = localld.B();
    if (!bool) {
      if (localld.f(d1, d2))
      {
        localz.add(new w(d1, d2));
        Point2D.Double localDouble = new Point2D.Double();
        if (!bool) {
          if (localld.b(d1, d2, localld.a() - 10.0D, d2, localDouble)) {
            localz.add(new w(localDouble.x, localDouble.y));
          }
        }
        if (!bool) {
          if (localld.b(d1, d2, localld.a() + localld.c() + 10.0D, d2, localDouble)) {
            localz.add(new w(localDouble.x, localDouble.y));
          }
        }
        if (!bool) {
          if (localld.b(d1, d2, d1, localld.b() - 10.0D, localDouble)) {
            localz.add(new w(localDouble.x, localDouble.y));
          }
        }
        if (bool) {
          break label306;
        }
        if (localld.b(d1, d2, d1, localld.b() + localld.d() + 10.0D, localDouble)) {
          localz.add(new w(localDouble.x, localDouble.y));
        }
      }
    }
    label306:
    if (!bool) {
      if ((this.N) && (paramd.e() == parame)) {
        localz.add(this.T);
      }
    }
    if (!this.N) {
      if (paramd.f() == parame) {
        localz.add(this.T);
      }
    }
    return localz;
  }
  
  public void mouseDraggedLeft(double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    if ((bool) || (this.H != null))
    {
      if (!bool) {
        if (G())
        {
          localObject = c(paramDouble1, paramDouble2);
          if (bool) {
            break label180;
          }
          if ((localObject == null) || (localObject == this.K.n())) {
            break label170;
          }
          this.K = this.i.a().w((e)localObject);
          Rectangle localRectangle = this.I.getBounds();
          a(this.K, this.H.c().i());
          localRectangle.add(this.I.getBounds());
          this.i.a(localRectangle.getX(), localRectangle.getY(), localRectangle.getWidth(), localRectangle.getHeight());
          if (bool) {
            break label180;
          }
          if (!ld.D) {
            break label170;
          }
        }
      }
      a(this.K, this.H.c().i());
      label170:
      this.m = paramDouble1;
      this.G = paramDouble2;
      label180:
      if (!bool) {}
      Object localObject = a(paramDouble1, paramDouble2, c(this.t), !b(this.t) ^ this.db);
      paramDouble1 = ((w)localObject).a;
      paramDouble2 = ((w)localObject).b;
      this.m = paramDouble1;
      this.G = paramDouble2;
      e(paramDouble1, paramDouble2);
      this.i.b();
    }
  }
  
  protected w a(double paramDouble1, double paramDouble2, boolean paramBoolean1, boolean paramBoolean2)
  {
    boolean bool = ld.E;
    if (!bool)
    {
      if (paramBoolean2)
      {
        if (!bool)
        {
          if (this.ab.n()) {
            this.ab.i();
          }
          this.R = a(paramDouble1, paramDouble2, 1.7976931348623157E+308D);
        }
        if (!bool) {
          if (this.R != null) {
            return this.R;
          }
        }
        return new w(paramDouble1, paramDouble2);
      }
      if (!bool) {
        this.R = null;
      }
    }
    else if (paramBoolean1)
    {
      if ((bool) || (this.ab.n())) {
        this.ab.i();
      }
      return new w(paramDouble1, paramDouble2);
    }
    w localw1 = a(paramDouble1, paramDouble2, this.S);
    if (!bool)
    {
      if (localw1 != null) {
        this.R = localw1;
      }
    }
    else {
      return localw1;
    }
    if (!bool) {
      if (this.ab.n())
      {
        w localw2 = this.ab.b(new w(paramDouble1, paramDouble2));
        paramDouble1 = localw2.a;
        paramDouble2 = localw2.b;
        return localw2;
      }
    }
    double d = this.S / this.i.M();
    if ((bool) || (this.X)) {
      return a(paramDouble1, paramDouble2, d, this.K, this.Y);
    }
    return new w(paramDouble1, paramDouble2);
  }
  
  private w a(double paramDouble1, double paramDouble2, double paramDouble3)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    w localw1 = new w(paramDouble1, paramDouble2);
    Object localObject = null;
    double d1 = paramDouble3;
    if ((bool2) || (d1 < 1.7976931348623157E+308D)) {
      d1 /= this.i.M();
    }
    y localy = this.J.h();
    do
    {
      if (!localy.e()) {
        break;
      }
      w localw2 = (w)localy.j();
      if (bool1) {
        break label134;
      }
      double d2 = w.a(localw1, localw2);
      if (!bool2)
      {
        if (d2 < d1)
        {
          d1 = d2;
          localObject = localw2;
        }
        localy.f();
      }
    } while (!bool1);
    label134:
    return localObject;
  }
  
  protected e c(double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    if (!bool)
    {
      if (this.N)
      {
        if (bool) {
          break label92;
        }
        if (this.H.c().h().f(paramDouble1, paramDouble2)) {
          return this.H.c().i().e();
        }
      }
      else
      {
        if (bool) {
          break label92;
        }
      }
    }
    else if (this.H.c().g().f(paramDouble1, paramDouble2)) {
      return this.H.c().i().f();
    }
    label92:
    return d(paramDouble1, paramDouble2).m();
  }
  
  protected sc d(double paramDouble1, double paramDouble2)
  {
    return a(paramDouble1, paramDouble2, 4, true);
  }
  
  protected void e(double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (this.P.n())
      {
        localObject = k();
        localtb = this.H.c();
        if (bool2) {
          break label76;
        }
        if (!bool1) {
          break label72;
        }
      }
    }
    Object localObject = this.P;
    tb localtb = this.P.t(this.P.q());
    label72:
    label76:
    if (!bool2)
    {
      if (this.N) {
        ((g)localObject).c(localtb.i(), new w(paramDouble1, paramDouble2));
      }
    }
    else
    {
      if (bool2) {
        break label141;
      }
      if (!bool1) {
        break label132;
      }
    }
    ((g)localObject).d(localtb.i(), new w(paramDouble1, paramDouble2));
    label132:
    if ((bool2) || (this.Z)) {
      label141:
      ud.a(this.i, localtb, paramDouble1, paramDouble2, this.N);
    }
  }
  
  private w a(double paramDouble1, double paramDouble2, double paramDouble3, ld paramld, w paramw)
  {
    boolean bool3 = ld.E;
    w localw = null;
    boolean bool1 = paramld.f(paramDouble1, paramDouble2);
    double d1 = paramDouble1;
    double d2 = paramDouble2;
    double d3;
    double d4;
    if (!bool3) {
      if (this.W)
      {
        d3 = paramw.a - paramDouble1;
        if (!bool3) {
          if (Math.abs(d3) < paramDouble3) {
            paramDouble1 = paramw.a;
          }
        }
        d4 = paramw.b - paramDouble2;
        if (bool3) {
          break label101;
        }
        if (Math.abs(d4) < paramDouble3) {
          paramDouble2 = paramw.b;
        }
      }
    }
    if (this.X)
    {
      label101:
      d3 = paramDouble1 - paramw.a;
      d4 = paramDouble2 - paramw.b;
      double d5 = Math.sqrt(d3 * d3 + d4 * d4);
      if ((bool3) || (d5 > 0.0D))
      {
        boolean bool2 = paramld.f(paramDouble1, paramDouble2);
        double d6 = paramDouble1 - paramDouble3 * d3 / d5;
        double d7 = paramDouble2 - paramDouble3 * d4 / d5;
        if (paramld.f(d6, d7) != bool2)
        {
          Point2D.Double localDouble1 = new Point2D.Double();
          if (!bool3) {
            if (bool2)
            {
              if (!paramld.b(paramDouble1, paramDouble2, d6, d7, localDouble1)) {
                break label422;
              }
              localw = new w(localDouble1.x, localDouble1.y);
              break label422;
            }
          }
          if (paramld.b(d6, d7, paramDouble1, paramDouble2, localDouble1)) {
            localw = new w(localDouble1.x, localDouble1.y);
          }
        }
        else
        {
          double d8 = paramDouble1 + paramDouble3 * d3 / d5;
          double d9 = paramDouble2 + paramDouble3 * d4 / d5;
          if (paramld.f(d8, d9) != bool2)
          {
            Point2D.Double localDouble2 = new Point2D.Double();
            if (!bool3) {
              if (bool2)
              {
                if (!paramld.b(paramDouble1, paramDouble2, d8, d9, localDouble2)) {
                  break label422;
                }
                localw = new w(localDouble2.x, localDouble2.y);
                break label422;
              }
            }
            if (paramld.b(d8, d9, paramDouble1, paramDouble2, localDouble2)) {
              localw = new w(localDouble2.x, localDouble2.y);
            }
          }
        }
      }
    }
    label422:
    if (!bool3) {
      if ((localw == null) && ((bool3) || (bool1)) && ((bool3) || (((d1 != paramDouble1) || ((bool3) || (d2 != paramDouble2))) && (!paramld.f(paramDouble1, paramDouble2))))) {
        return new w(d1, d2);
      }
    }
    if (!bool3) {}
    return localw != null ? localw : new w(paramDouble1, paramDouble2);
  }
  
  protected boolean a(d paramd)
  {
    return qf.a(paramd, k());
  }
  
  public void mouseShiftReleasedLeft(double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (this.M)
      {
        if (bool) {
          break label37;
        }
        mouseReleasedLeft(paramDouble1, paramDouble2);
        if (!ld.D) {
          return;
        }
      }
    }
    label37:
    b(paramDouble1, paramDouble2, this.db);
  }
  
  private void I()
  {
    boolean bool = ld.E;
    if (!bool)
    {
      if (this.ab != null) {
        this.ab.g();
      }
      this.i.a(P());
      this.i.e(0);
      this.i.b(this.I);
      this.I = null;
      a(false);
    }
    g localg = k();
    if (!bool) {
      if (this.fb != null)
      {
        localg.b(this.fb);
        this.fb = null;
      }
    }
    this.i.removePropertyChangeListener("Graph2D", this.gb);
    localg.gb();
  }
  
  private void J()
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if ((bool2) || (G()))
    {
      g localg = k();
      j localj = localg.K();
      d locald = this.H.c().i();
      e locale1;
      e locale2;
      e locale3;
      if (!bool2) {
        if (this.N)
        {
          if ((!bool2) && (this.H.c().h() == this.K)) {
            return;
          }
          locale1 = this.K.n();
          locale2 = locald.f();
          if (((bool2) || (localj != null)) && ((bool2) || (localj.e(locald))))
          {
            locale3 = localj.c(locald);
            localj.d(locald).b("HierarchyManager.InterEdgeData.SOURCE_PORT");
            localj.a(locald, locale1, locale3);
            if (bool2) {
              break label174;
            }
            if (!bool1) {}
          }
          else
          {
            localg.a(locald, locale1, locale2);
          }
          if (bool2) {
            break label178;
          }
          b(locald);
          if (!bool1) {
            label174:
            return;
          }
        }
      }
      label178:
      if ((bool2) || (this.H.c().g() != this.K))
      {
        locale1 = this.K.n();
        locale2 = locald.e();
        if (((bool2) || (localj != null)) && ((bool2) || (localj.e(locald))))
        {
          locale3 = localj.b(locald);
          localj.d(locald).b("HierarchyManager.InterEdgeData.TARGET_PORT");
          localj.a(locald, locale3, locale1);
          if (!bool1) {}
        }
        else
        {
          localg.a(locald, locale2, locale1);
        }
        b(locald);
      }
    }
  }
  
  public void mouseReleasedRight(double paramDouble1, double paramDouble2)
  {
    mouseReleasedLeft(paramDouble1, paramDouble2);
  }
  
  public void mouseShiftReleasedRight(double paramDouble1, double paramDouble2)
  {
    mouseShiftReleasedLeft(paramDouble1, paramDouble2);
  }
  
  public void mouseReleasedLeft(double paramDouble1, double paramDouble2)
  {
    if (!ld.E) {}
    b(paramDouble1, paramDouble2, !this.db);
  }
  
  private void b(double paramDouble1, double paramDouble2, boolean paramBoolean)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (this.H != null)
      {
        w localw = a(paramDouble1, paramDouble2, c(this.v), paramBoolean);
        paramDouble1 = localw.a;
        paramDouble2 = localw.b;
        e(paramDouble1, paramDouble2);
        J();
        K();
        e(paramDouble1, paramDouble2);
        a(this.H, paramDouble1, paramDouble2);
        I();
      }
    }
    if (!bool)
    {
      if (this.Q)
      {
        k().A();
        this.Q = false;
      }
      if (bool) {}
    }
    else if (a())
    {
      a(false);
    }
    g();
  }
  
  protected void b(d paramd) {}
  
  protected void a(zd paramzd) {}
  
  protected void a(zd paramzd, double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    if ((bool) || ((C()) && (D())))
    {
      tb localtb = paramzd.c();
      jd localjd = f(paramDouble1, paramDouble2);
      if (localjd != null)
      {
        if (!bool)
        {
          if (this.N)
          {
            if (bool) {
              break label78;
            }
            localjd.a(localtb);
          }
        }
        else if (!ld.D) {
          return;
        }
        label78:
        localjd.c(localtb);
      }
    }
  }
  
  private jd f(double paramDouble1, double paramDouble2)
  {
    return jd.a(this.K, paramDouble1, paramDouble2);
  }
  
  private void K()
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if ((bool2) || (!this.P.n()))
    {
      tb localtb = this.P.t(this.P.q());
      int i = 0;
      label126:
      do
      {
        if (i >= localtb.n()) {
          break;
        }
        eb localeb = localtb.b(i);
        if (bool2) {
          break label144;
        }
        if (bool1) {
          break label143;
        }
        if (!bool2)
        {
          if (this.L.n() <= i) {
            this.L.a(localeb.b(), localeb.c());
          }
        }
        else
        {
          if (bool2) {
            continue;
          }
          if (!bool1) {
            break label126;
          }
        }
        this.L.b(i).a(localeb.b(), localeb.c());
        i++;
      } while (!bool1);
      if (!bool2)
      {
        label143:
        label144:
        this.L.b(true);
        this.i.b(this.P);
      }
      this.P.o();
    }
  }
  
  protected void a(Graphics2D paramGraphics2D, w paramw, e parame, d paramd)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (!L())
      {
        if (!bool) {}
        if (bool) {
          break label58;
        }
      }
    }
    label58:
    a(paramGraphics2D, paramw, parame, paramd, (!b(this.t) ^ this.db), paramw.equals(this.R));
  }
  
  protected void a(Graphics2D paramGraphics2D, w paramw, e parame, d paramd, boolean paramBoolean1, boolean paramBoolean2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (paramBoolean1)
      {
        if (!bool2)
        {
          if (paramBoolean2)
          {
            paramGraphics2D.setColor(Color.green);
            if (bool2) {
              return;
            }
            if (!bool1) {
              break label79;
            }
          }
          paramGraphics2D.setColor(Color.red);
          if (bool2) {
            return;
          }
        }
        if (!bool1) {
          break label79;
        }
      }
    }
    if (this.db) {
      return;
    }
    paramGraphics2D.setColor(Color.gray);
    label79:
    this.ib.setFrame(paramw.a() - 3.0D, paramw.b() - 3.0D, 6.0D, 6.0D);
    paramGraphics2D.fill(this.ib);
    paramGraphics2D.setColor(Color.black);
    paramGraphics2D.draw(this.ib);
  }
  
  public boolean L()
  {
    return this.M;
  }
  
  public void p(boolean paramBoolean)
  {
    this.M = paramBoolean;
  }
  
  public void b()
    throws UnsupportedOperationException
  {
    if ((ld.E) || (a())) {
      mouseReleasedLeft(this.m, this.G);
    }
  }
  
  protected void a(Graphics2D paramGraphics2D, ld paramld)
  {
    c(paramGraphics2D, paramld);
  }
  
  static void c(Graphics2D paramGraphics2D, ld paramld)
  {
    int i = (int)paramld.a();
    int j = (int)paramld.b();
    int k = (int)paramld.c();
    int n = (int)paramld.d();
    a(paramGraphics2D, i, j, k, n);
  }
  
  static void a(Graphics2D paramGraphics2D, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    Color localColor = paramGraphics2D.getColor();
    paramGraphics2D.setColor(Color.black);
    a(paramGraphics2D, paramInt1, paramInt2, paramInt3, paramInt4, 5);
    a(paramGraphics2D, paramInt1, paramInt2, paramInt3, paramInt4, 3);
    paramGraphics2D.setColor(Color.white);
    a(paramGraphics2D, paramInt1, paramInt2, paramInt3, paramInt4, 4);
    paramGraphics2D.setColor(localColor);
  }
  
  private static void a(Graphics2D paramGraphics2D, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5)
  {
    int i = paramInt1;
    int j = paramInt2;
    paramGraphics2D.drawLine(i - paramInt5, j - paramInt5, i, j - paramInt5);
    paramGraphics2D.drawLine(i - paramInt5, j - paramInt5, i - paramInt5, j);
    i += paramInt3;
    paramGraphics2D.drawLine(i + paramInt5, j - paramInt5, i, j - paramInt5);
    paramGraphics2D.drawLine(i + paramInt5, j - paramInt5, i + paramInt5, j);
    i = paramInt1;
    j += paramInt4;
    paramGraphics2D.drawLine(i - paramInt5, j + paramInt5, i, j + paramInt5);
    paramGraphics2D.drawLine(i - paramInt5, j + paramInt5, i - paramInt5, j);
    i += paramInt3;
    paramGraphics2D.drawLine(i + paramInt5, j + paramInt5, i, j + paramInt5);
    paramGraphics2D.drawLine(i + paramInt5, j + paramInt5, i + paramInt5, j);
  }
  
  private Rectangle2D M()
  {
    Rectangle2D.Double localDouble = new Rectangle2D.Double();
    if ((ld.E) || (this.K != null)) {
      this.K.b(localDouble);
    }
    return localDouble;
  }
  
  public Cursor O()
  {
    return Cursor.getPredefinedCursor(13);
  }
  
  public Cursor P()
  {
    return Cursor.getPredefinedCursor(0);
  }
  
  static final class f_
    extends g
    implements qb
  {
    public void paint(Graphics2D paramGraphics2D)
    {
      d locald = q();
      if (locald != null) {
        t(locald).c(paramGraphics2D);
      }
    }
    
    public Rectangle getBounds()
    {
      return d();
    }
  }
  
  class e_
    implements qb
  {
    a.c.z a;
    Rectangle2D b;
    d c;
    e d;
    
    e_(a.c.z paramz, Rectangle2D paramRectangle2D, e parame, d paramd)
    {
      this.a = paramz;
      this.b = paramRectangle2D;
      this.d = parame;
      this.c = paramd;
    }
    
    public void paint(Graphics2D paramGraphics2D)
    {
      boolean bool2 = ld.E;
      boolean bool1 = ld.D;
      y localy = this.a.h();
      do
      {
        do
        {
          if (!localy.e()) {
            break;
          }
          w localw = (w)localy.j();
          xf.this.a(paramGraphics2D, localw, this.d, this.c);
          localy.f();
          if ((!bool2) && (bool1)) {
            return;
          }
        } while (!bool1);
        if (bool2) {
          break;
        }
      } while (bool2);
      if (xf.this.eb) {
        if ((bool2) || (xf.this.K != null)) {
          xf.this.a(paramGraphics2D, xf.this.K);
        }
      }
    }
    
    public Rectangle getBounds()
    {
      boolean bool = ld.E;
      if (!bool) {
        if (xf.this.eb)
        {
          if (bool) {
            break label54;
          }
          if (xf.this.K != null) {
            return this.b.getBounds().createUnion(xf.this.M()).getBounds();
          }
        }
      }
      label54:
      return this.b.getBounds();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.xf

 * JD-Core Version:    0.7.0.1

 */